package com.yzf.enterprise.common.utils;

import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;

/**
 * @author shadowyy
 * @version 2020/4/15 15:16
 */
public class LocalDateTimeUtil {

    public static long getMilliSecond(LocalDateTime localDateTime) {
        return LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli();
    }

    public static LocalDateTime str2LocalDateTime(String str) {
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        return LocalDateTime.parse(str,df);
    }

}
